package org.dandsoft.blackbox.laboratory.tests.replace;

import org.dandsoft.blackbox.SignalId;

/**
 * @author Vilyuzhanin Denis (Fin)
 */
public class LevelSignalId extends SignalId {

    private int level;

    public LevelSignalId(int level, long value) {
        super(value);
        this.level = level;
    }

    public int getLevel() {
        return level;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        LevelSignalId that = (LevelSignalId) o;

        if (level != that.level) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + level;
        return result;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("LevelSignalId");
        sb.append("{level=").append(level).append(", ");
        sb.append("{id=").append(super.toString());
        sb.append('}');
        return sb.toString();
    }
}
